package com.cnyz.mapper;

import com.cnyz.entity.Course;
import com.cnyz.entity.StudentCourse;
import com.cnyz.vo.CourseVo;
import com.cnyz.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CourseMapper {

    public void insertCourse(Course course);
    public void updateCourse(Course course);
    public void deleteCourse(Long courseID);

    public List<CourseVo> selectAllCourse();
    public List<CourseVo> selectCourseByTeacherID(Long teacherID);
    public List<CourseVo> selectCourseByStudentID(Long studentID);

    void addStudentToCourse(StudentCourse studentCourse);

    public List<UserVo> selectStudentByCourseID(Long courseID);
    public Boolean isStudentInCourse(@Param("courseID") Long courseID, @Param("studentID") Long studentID);
    public void removeStudentFromCourse(@Param("courseID") Long courseID, @Param("studentID") Long studentID);
    public List<UserVo> getMembersByName(@Param("courseID") Long courseID, @Param("username") String username);

}
